<!--  参建项目 -->
<template>
	<uni-section title="参建项目" type="line"> </uni-section>
	<uni-card v-for="(item,index) in listData" :key="index" spacing="0" padding="0" margin="0 10px 10px"
		:is-shadow="false" :border="false">
		<view class="layout-dom">
			<view class="slot-title ">
				<text class="title">{{item.projectName}}</text>
			</view>
			<view class="flex-row item-dom">
				<view class="title">
					<text class="iconfont icon-gongsi" style="padding-right: 15rpx; color: #01c2b7"></text>
					<text>所属企业：</text>
				</view>
				<view class="content">{{item.projectEnterprise}}</view>
			</view>
			<view class="flex-row item-dom">
				<view class="title">
					<text class="iconfont icon-gangwei" style="padding-right: 15rpx; color: #01c2b7"></text>
					<text>所属岗位：</text>
				</view>
				<view class="content">{{item.projectPosition}}</view>
			</view>
			<view class="flex-row item-dom">
				<view class="title">
					<text class="iconfont icon-describe" style="padding-right: 15rpx; color: #01c2b7"></text>
					<text>工作内容：</text>
				</view>
				<view class="content">{{item.projectDescribe}}</view>
			</view>
			<view class="flex-row item-dom">
				<view class="title">
					<text class="iconfont icon-wodechengguo" style="padding-right: 15rpx; color: #01c2b7"></text>
					<text>工作成果：</text>
				</view>
				<view class="content">{{item.projectAchievement}}</view>
			</view>
		</view>
		<cImage :imageList="item.projectList" />
	</uni-card>
	<uni-card v-if="listData.length < 1 && !showLoading" spacing="0" margin="0 10px 10px" :is-shadow="false"
		:border="false">
		<view class="no-data">暂无项目记录</view>
	</uni-card>
	<cloading v-if="showLoading" />
</template>

<script lang="ts" setup>
	import { queryProject } from "@/api/preview"
	import cImage from "./c-image.vue";
	import cloading from "./c-loading.vue";
	import { ref, onBeforeMount } from 'vue'

	const props = defineProps({
		userData: {
			type: Object,
			default: function () {
				return {};
			}
		}
	})
	let listData = ref([])
	let showLoading = ref(true)

	onBeforeMount(() => {
		getList(props.userData)
	})

	function getList(obj) {
		queryProject(obj).then(res => {
			if (res.code == '200') {
				listData.value = res.data || []
			}
		}).finally(() => {
			showLoading.value = false
		})
	}
</script>

<style lang="scss" scoped>
	.layout-dom {
		padding: 10px 10px 0 10px;
		line-height: 20px;
	}

	.flex-row {
		.title {
			width: 100px;
		}

		.content {
			width: calc(100% - 100px);
		}
	}
	.no-data{
		text-align: center;
		font-size: 24rpx;
	}
</style>